-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: timedeltas.pyi #40766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TYP: timedeltas.pyi #40766
Conversation
@simonjayhawkins im pretty sure this is non-actionable based on what I read in python/mypy#1020, but would like your say-so before mothballing this |
yes. looks tricky. I would add ignores for now since imo the benefit of the added types outweighs the extra ignores. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need some lint checks on the stubs.
pandas/_libs/tslibs/timedeltas.pyi
Outdated
from datetime import timedelta | ||
from time import struct_time | ||
from typing import ( | ||
AnyStr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
pandas/_libs/tslibs/timedeltas.pyi
Outdated
from typing import ( | ||
AnyStr, | ||
ClassVar, | ||
Optional, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
pandas/_libs/tslibs/timedeltas.pyi
Outdated
AnyStr, | ||
ClassVar, | ||
Optional, | ||
SupportsAbs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
pandas/_libs/tslibs/timedeltas.pyi
Outdated
Tuple, | ||
Type, | ||
TypeVar, | ||
Union, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
pandas/_libs/tslibs/timedeltas.pyi
Outdated
@@ -0,0 +1,106 @@ | |||
from datetime import timedelta | |||
from time import struct_time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
pandas/_libs/tslibs/timedeltas.pyi
Outdated
import numpy as np | ||
|
||
from pandas._libs.tslibs import ( | ||
NaT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
updated per comments |
@simonjayhawkins mypy is unhappy about
Timedelta.__new__
potentially returningNaT
. Thoughts on how to handle this? (it'll come up again in Timestamp and Period)